package com.cj.services;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.cj.Mapper.TestMapper;
import com.cj.models.TestModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@DS("crdDS")
public class TestService {

    @Autowired
    TestMapper testMapper;
    public int testNum(){
        TestModel testModel = this.testMapper.selectById("1");
        UpdateWrapper<TestModel> updateWrapper = new UpdateWrapper<>();
        updateWrapper.setSql("test_num=test_num+1");
        return this.testMapper.update(testModel,updateWrapper);
    }
}
